package com.example.dahua.singleton;

/**
 * @author: dangwen
 * @createDate: 2021/7/3
 * 双检索
 */
public class Singleton04 {
    private static Singleton04 singleton04 = null;
    private Singleton04(){}
    public static Singleton04 getSingleton04(){
        if (singleton04 == null){
            synchronized (Singleton04.class){
                if(singleton04 == null){
                    singleton04 = new Singleton04();
                }
            }
        }
        return singleton04;
    }
}
